#include "dialog_set.h"
#include "ui_dialog_set.h"
#include "dialog_newlistfile.h"
#include "ui_dialog_newlistfile.h"

#include "mainwindow.h"
#include "ui_mainwindow.h"

Dialog_SET::Dialog_SET(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog_SET)
{
    ui->setupUi(this);


    MainWindow *fartherwindow = (MainWindow *)parentWidget();
    if(fartherwindow != NULL)
    {
        ui->lineEdit_index->setText(fartherwindow->FileIndexStartAddr);
        ui->lineEdit_2_dataaddr->setText(fartherwindow->FileDataStartAddr);
    }

}

Dialog_SET::~Dialog_SET()
{
    delete ui;
}

void Dialog_SET::on_pushButton_clicked()
{
    MainWindow *fartherwindow = (MainWindow *)parentWidget();
    if(fartherwindow != NULL)
    {
        fartherwindow->setFileAddr( ui->lineEdit_index->text(),ui->lineEdit_2_dataaddr->text());
    }
    close();
}

void Dialog_SET::on_pushButton_2_clicked()
{
    close();
}
